num=[]
ans=[]
def Init():
    global num
    num=list(map(lambda x:int(x),str(input()).strip()))
def Continuous(start):
    global num
    last_num=num[start]
    con=0
    for now in num:
        if(not now==last_num):
            break
        con+=1
        last_num=now
    if(con==0):
        return last_num,start+1
    a=[con,last_num]
    return a,start+con+1
def P_code():
    global num,ans
    last_num=num[0]
    con=0
    for i in num:
        if(i==last_num):
            con+=1
            last_num=i
        else:
            if(con==1):
                ans.append(last_num)
            else:
                a=[]
                a.append(con)
                a.append(last_num)
                ans.append(a)
            con=1
            last_num=i
    if(con==1):
           ans.append(last_num)
    else:
           a=[]
           a.append(con)
           a.append(last_num)
           ans.append(a)
def Main():
    Init()
    P_code()
    print(ans)
Main()